home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / jpdoor32.zip / MULTI.DOC < prev    next >
Text File  |  1992-02-26  |  16KB  |  393 lines

  1.  
  2.            ┌──────────────────────────────────────────────┐
  3.            │             MOTOR CITY SOFTWARE              │
  4.            │   ┌──────────────────────────────────────┐   │
  5.            │   │       JPDoor - Version 3.1 SE        │   │
  6.            │   │        Copyright 1990 - 1992         │   │
  7.            │   │            ┌──────────┐              │   │
  8.            │   │            │\         │              │   │
  9.            │   │            │ \        │              │   │
  10.            │   │            │  \   P   │              │   │
  11.            │   │            │   \  A   │              │   │
  12.            │   │            │   │  S   │              │   │
  13.            │   │            │   │  C   │              │   │
  14.            │   │     5.5    │   │  A   │    6.0       │   │
  15.            │   │            │  o│  L   │              │   │
  16.            │   │            │   │      │              │   │
  17.            │   │            \   │──────┘              │   │
  18.            │   │             \  │                     │   │
  19.            │   └──────────────\ │─────────────────────┘   │
  20.            │      The Ultimate \│ Door Writing Unit.      │
  21.            └────────────────────┴─────────────────────────┘
  22.  
  23.  
  24.  
  25.   This file contains information on writing doors that work in a multi-node
  26.   environment. While your door may not be multi-player, we would recommend
  27.   that you read over the following information anyways.
  28.  
  29.  
  30.   With the number of Multi-Node BBS's steadily increasing, we felt it was
  31.   very important to make it easy on the programmer to make his doors multi-
  32.   node aware.  This release of JPDoor has many new features that make it easy
  33.   to write programs which work in a multi-node environment, even if you are
  34.   not running multi-node yourself.  We have taken this one step further, in
  35.   that you can easily write doors which allow players to compete head-to-head!
  36.  
  37.   While some of this may sound complex, it really is quite simple.
  38.  
  39.   JPDoor will only allow multi-player games on RemoteAccess V 1.xx and
  40.   QuickBBS V 2.75. Future versions will also include full support for PCBoard.
  41.   SHARE MUST BE LOADED!
  42.  
  43.   Some of the multi-node capabilities included are:
  44.  
  45.   - Listing Other Users Currently Online
  46.   - Sending Online Messages to other users
  47.   - Determining the node number that the current user is logged onto
  48.   - Determining who is logged onto other nodes
  49.   - File/Record locking routines so your door can run on more than one node
  50.     at a time
  51.   - A method to ensure that your door is only run on one node at a time if
  52.     need be
  53.   - The ability for two nodes to pass data back and forth
  54.  
  55.   This document is going to try to explain how to write a door which allows
  56.   two players, and passes game data back and forth between them.  These
  57.   routines have been tested extensively, and while they appear to be working
  58.   fine, there exists a possibility that there are systems which may have
  59.   problems.  Because of this, we will be working closely with anyone having
  60.   problems.  If problems are discovered, then beta versions will be made
  61.   available to any registered user who requests it.
  62.  
  63.  
  64.   To start with, some basic concepts...
  65.  
  66.         Multi-player doors will only work with QBBS 2.75 or RA 1.xx
  67.         All data is passed in a file called JPDOOR.USE which will be
  68.         created in the system directory pointed to by either the RA
  69.         or QUICK environment variable.
  70.  
  71.         JPDoor has defined the structure for this file as follows:
  72.  
  73. TYPE
  74.    JPUseData        = Array[1..2048] of Byte;
  75.    JPUSErecord      = record
  76.                       Name           : String[35];
  77.                       Line           : Byte;
  78.                       DoorName       : String[20];
  79.                       Status         : Byte;
  80.                       MaxPlayers     : Byte;
  81.                       Filler         : Array[1..13] of byte;
  82.                       MultiNode      : Boolean;
  83.                       PID            : Integer;
  84.                       Data           : JPUseData;
  85.                     End;
  86.  
  87.                     { Status Byte :  0 - New Record Added   }
  88.                     {                1 - New Data Written   }
  89.                     {                2 - Data Has Been Read }
  90.  
  91. Var
  92.   JPUse         : JPUseRecord;   { Variable to hold MY record}
  93.   JPUseOther    : JPUseRecord;   { Variable to hold OTHER users record }
  94.  
  95.         Lets look at each field :
  96.  
  97.         Name       - This is the name of the user currently online
  98.  
  99.         Line       - This is the node number the user is on. This does
  100.                      not default to 1 like the dorinfo1.def does, and you
  101.                      can get the users node with the function GetNode.
  102.                      GetNode will simply search USERON.BBS for the users
  103.                      name as defined in dorinfo1.def, and return the actual
  104.                      node he is loggend onto.
  105.  
  106.         DoorName   - This is the name of your door. Its best to keep this to
  107.                      15 characters or less. When JPDoor's Whoson procedure is
  108.                      called, it will display this so other users can see that
  109.                      your door is in use.
  110.  
  111.         Status     - This is used internally, and you need not worry about it.
  112.                      The following values are used :
  113.                         0 - New Record Added
  114.                         1 - New Data Written
  115.                         2 - Data Has Been Read
  116.  
  117.         MaxPlayers - This contains the maximum number of users who can play
  118.                      at one time.  Currently, JPDoor will only support 2
  119.                      players, but this will be increased in future versions.
  120.  
  121.         MultiNode  - True if your door allows more than one user to run the
  122.                      door at the same time.
  123.  
  124.         PID        - If your Door is a multi-player door, then you MUST apply
  125.                      for a Product ID code. You must be registered in order
  126.                      to receive one. In order to test your door, use a PID of
  127.                      0. If you attempt to use any other value, it will abort!
  128.  
  129.         Data      - This is where all the data is passed back and forth between
  130.                     two nodes. This is explained in detail below.
  131.  
  132.  
  133. A note about PIDs.
  134.                      The PID is used to ensure that you only try to read data
  135.                      written by YOUR door on another node. You dont want a
  136.                      battleship door reading a data file from an X's and O's
  137.                      door etc...  The PID is validated internally by JPDoor.
  138.                      The Value of 0 is for test purposes only, as we do not
  139.                      want to force you to register BEFORE you can test it.
  140.                      If you release a multi-player door using a 0 for a PID,
  141.                      then you run the risk of it conflicting with other doors!
  142.                      You will need a PID for each and every different multi-
  143.                      player game you write.
  144.  
  145.                      There is no fee for registering a PID, and there is no
  146.                      limit to the number of PIDs you may register, but you
  147.                      must be a registered user of JPDoor.
  148.  
  149.                      PID 0 is ONLY for testing purposes, and you are expected
  150.                      to register JPDoor and request a PID BEFORE you release
  151.                      your door.
  152.  
  153.  
  154. How it all works.
  155.  
  156.  
  157.         First, you need to decide what data you wish to pass back and forth.
  158.         Define a structure that is exactly 2048 bytes in size. An example
  159.         from my BattleShips door follows:
  160.  
  161.  TYPE
  162.    Grid          = Array[1..9,0..9] of Char; { Letter,Number }
  163.  
  164.    NodeData      = Record
  165.         Status     : Byte;
  166.         PlayerName : String[25];
  167.         SeaGrid    : Grid;
  168.         ShotN,
  169.         ShotL      : Byte;
  170.         ShipHits   : Array[1..6] of byte;
  171.         ChatLine   : String[78];
  172.         Local      : Boolean;
  173.         Filler     : Array[1..1843] of Byte;  {this is added to ensure that}
  174.